/*
 * Copyright (C) 2023 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.xuexiang.templateproject.presenter;
//
//import com.jcds.common.net.BaseResponse;
//import com.jcds.common.net.RxSchedulers;
//import com.jcds.common.rx.scheduler.BaseObsrver;
//import com.jcds.learneasy.base.BasePresenter;
//import com.jcds.learneasy.entity.SubjectManagerEntity;
//import d.m.b.f.y;
//import f.a.l;
import com.xuexiang.templateproject.R;
import com.xuexiang.templateproject.bean.SubjectManagerEntity;
import com.xuexiang.templateproject.http.BaseObsrver;
import com.xuexiang.templateproject.http.BaseResponse;
import com.xuexiang.templateproject.http.RxSchedulers;
import com.xuexiang.templateproject.view.SubjectContract;
//import com.xuexiang.xhttp2.utils.RxSchedulers;

import io.reactivex.Observable;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/* compiled from: SubjectManagerPresenter.kt */
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016J\b\u0010\u000b\u001a\u00020\u0006H\u0016J \u0010\f\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\r\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016J\u0018\u0010\u000e\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\r\u001a\u00020\bH\u0016¨\u0006\u000f"}, d2 = {"Lcom/jcds/learneasy/presenter/SubjectManagerPresenter;", "Lcom/jcds/learneasy/base/BasePresenter;", "Lcom/jcds/learneasy/contract/SubjectContract$SubjectView;", "Lcom/jcds/learneasy/contract/SubjectContract$SubjectPresenter;", "()V", "createSubject", "", "operation", "", "courseName", "", "getSubjects", "reNameSubject", "courseId", "updateSubject", "app_huaweiRelease"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes2.dex */
public final class SubjectManagerPresenter extends BasePresenter<SubjectContract>  {


    public final class SubjectManagerObsrver extends BaseObsrver<SubjectManagerEntity> {
        public SubjectManagerObsrver(SubjectContract yVar) {
            super(yVar, false);
        }

        /* renamed from: a */
        public void onSuccess(@Nullable SubjectManagerEntity subjectManagerEntity) {
            SubjectContract c2 = SubjectManagerPresenter.this.getMRootView();
            if (c2 != null) {
                Intrinsics.checkNotNull(subjectManagerEntity);
                c2.getSubjectSuccess(subjectManagerEntity);
            }
        }
    }


    public void saveCourse(int operation, @NotNull String courseName) {
        Intrinsics.checkNotNullParameter(courseName, "courseName");
        checkViewAttached();
        SubjectContract rootView = getMRootView();
        if (rootView != null) {
            rootView.showLoading();
        }
        Observable<BaseResponse<SubjectManagerEntity>> C = getService().C(operation, courseName);
        RxSchedulers.Companion companion = RxSchedulers.Companion;
        Observable<BaseResponse<SubjectManagerEntity>> compose = C.compose(companion.request(rootView.getContext()));
        SubjectManagerObsrver disposable = (SubjectManagerObsrver) compose.subscribeWith(new SubjectManagerObsrver(rootView));
        Intrinsics.checkNotNullExpressionValue(disposable, "disposable");
        addSubscription(disposable);
    }
//
    public void queryAllCourse() {
//        checkViewAttached();
//        SubjectContract rootView = getMRootView();
//        if (rootView != null) {
//            rootView.showLoading();
//        }
//        Observable<BaseResponse<SubjectManagerEntity>> Z = getService().Z();
//        RxSchedulers.Companion companion = RxSchedulers.Companion;
//        y c3 = c();
//        Intrinsics.checkNotNull(c3);
//        Observable<R> compose = Z.compose(companion.request(rootView.getContext()));
//        SubjectContract c4 = c();
//        Intrinsics.checkNotNull(c4);
//        b disposable = (b) compose.subscribeWith(new b(c4));
//        Intrinsics.checkNotNullExpressionValue(disposable, "disposable");
//        addSubscription(disposable);
    }

    public void saveCourse(int operation, int courseId, @NotNull String courseName) {
        Intrinsics.checkNotNullParameter(courseName, "courseName");
        checkViewAttached();
        SubjectContract c2 = getMRootView();
        if (c2 != null) {
            c2.showLoading();
        }
//        Observable<BaseResponse<SubjectManagerEntity>> A = getService().A(i2, i3, courseName);
//        RxSchedulers.Companion companion = RxSchedulers.Companion;
//        SubjectContract c3 = c();
//        Intrinsics.checkNotNull(c3);
//        Observable<R> compose = A.compose(companion.request(c3.getContext()));
//        SubjectContract c4 = c();
//        Intrinsics.checkNotNull(c4);
//        c disposable = (c) compose.subscribeWith(new c(c4));
//        Intrinsics.checkNotNullExpressionValue(disposable, "disposable");
//        addSubscription(disposable);
    }

    public void saveCourse(int operation, int courseId) {
//        b();
//        SubjectContract c2 = c();
//        if (c2 != null) {
//            c2.showLoading();
//        }
//        l<BaseResponse<SubjectManagerEntity>> i4 = getService().i(i2, i3);
//        RxSchedulers.Companion companion = RxSchedulers.Companion;
//        SubjectContract c3 = c();
//        Intrinsics.checkNotNull(c3);
//        l<R> compose = i4.compose(companion.request(c3.getContext()));
//        SubjectContract c4 = c();
//        Intrinsics.checkNotNull(c4);
//        d disposable = (d) compose.subscribeWith(new d(c4));
//        Intrinsics.checkNotNullExpressionValue(disposable, "disposable");
//        a(disposable);
    }
}